package homeWork;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Scanner;

public class Test4 {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        FileOutputStream fos = new FileOutputStream("D:\\a\\b.txt");
        lo:while (true) {
            String stu = sc.next();
            if (stu.equals("end")){
                break lo;
            }
            byte[] bytes = stu.getBytes();
            fos.write(bytes);
            fos.write("\r\n".getBytes());
        }
        fos.close();
    }
}
